package com.cycling.app.bean;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Created by LiZhanPing on 2017/5/6.
 */

public class User implements Parcelable{

    private long id;
    private String username;
    private String mobile;
    private double money;

    public User() {
    }

    public User(long id, String username, String mobile, double money) {
        this.id = id;
        this.username = username;
        this.mobile = mobile;
        this.money = money;
    }

    protected User(Parcel in) {
        id = in.readLong();
        username = in.readString();
        mobile = in.readString();
        money = in.readDouble();
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeLong(id);
        dest.writeString(username);
        dest.writeString(mobile);
        dest.writeDouble(money);
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public static final Creator<User> CREATOR = new Creator<User>() {
        @Override
        public User createFromParcel(Parcel in) {
            return new User(in);
        }

        @Override
        public User[] newArray(int size) {
            return new User[size];
        }
    };

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public double getMoney() {
        return money;
    }

    public void setMoney(double money) {
        this.money = money;
    }
}
